<!--
 * @Description: flex布局 - 弹性布局
 * @Author: rendc
 * @Date: 2025-09-16 09:36:15
 * @LastEditors: rendc
 * @LastEditTime: 2025-09-16 10:12:44
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>flex布局</title>
  <style>
    body {
      margin: 0;
    }

    .app {
      /* 父元素设置为弹性容器 */
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      /* justify-content: space-between; */
    }

    .my_div {
      /*当前元素占1份空间 */
      /* flex: 1; */
      width: 500px;
      /* height: 200px; */
      border: 1px solid red;
      /* 水平居中 */
      text-align: center;
      /* 垂直居中 */
      /* line-height: 200px; */
      font-size: 26px;
      font-weight: 500;
    }

    .my_div1,
    .my_div3,
    .my_div4,
    .my_div5 {
      /* flex: 1; */
    }

    .my_div2 {
      /* flex: 2; */
    }
  </style>
</head>

<body>
  <div class="app">
    <div class="my_div my_div1">1</div>
    <div class="my_div my_div2">2</div>
    <div class="my_div my_div3">3</div>
    <div class="my_div my_div4">4</div>
    <div class="my_div my_div5">5</div>
  </div>
</body>

</html>